var emojis = [
    "smile", "iphone", "girl", "smiley", "heart", "kiss", "copyright", "coffee",
    "a", "ab", "airplane", "alien", "ambulance", "angel", "anger", "angry",
    "arrow_forward", "arrow_left", "arrow_lower_left", "arrow_lower_right",
    "arrow_right", "arrow_up", "arrow_upper_left", "arrow_upper_right",
    "art", "astonished", "atm", "b", "baby", "baby_chick", "baby_symbol",
    "balloon", "bamboo", "bank", "barber", "baseball", "basketball", "bath",
    "bear", "beer", "beers", "beginner", "bell", "bento", "bike", "bikini",
    "bird", "birthday", "black_square", "blue_car", "blue_heart", "blush",
    "boar", "boat", "bomb", "book", "boot", "bouquet", "bow", "bowtie",
    "boy", "bread", "briefcase", "broken_heart", "bug", "bulb",
    "person_with_blond_hair", "phone", "pig", "pill", "pisces", "plus1",
    "point_down", "point_left", "point_right", "point_up", "point_up_2",
    "police_car", "poop", "post_office", "postbox", "pray", "princess",
    "punch", "purple_heart", "question", "rabbit", "racehorse", "radio",
    "up", "us", "v", "vhs", "vibration_mode", "virgo", "vs", "walking",
    "warning", "watermelon", "wave", "wc", "wedding", "whale", "wheelchair",
    "white_square", "wind_chime", "wink", "wink2", "wolf", "woman",
    "womans_hat", "womens", "x", "yellow_heart", "zap", "zzz", "+1",
    "-1", "0", "1", "109", "2", "3", "4", "5", "6", "7", "8", "8ball", "9"
];

/*$(function(){
		var xmlHttp;
		
		function createAjax(){
			if(window.ActiveXObject){
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}else{
				xmlHttp=new XMLHttpRequest();
			}
		}
		function callBack(){
			arraylist=new Array();
			var readystate=xmlHttp.readyState;
			if(readystate==4){
				if(xmlHttp.status==200){
					var json=xmlHttp.responseText;
					var list=eval('('+json+')');
					for(var n=0;n<list.length;n++){
						arraylist[n]=list[n].name;
						alert(arraylist[n]);
					}
					return arraylist;
				}
			}
		}
		function getArray(){
			createAjax();
			xmlHttp.open("get","json.jspx");
			xmlHttp.onreadystatechange=callBack;
			xmlHttp.send();
		}
});*/



	$.get("json.jspx",function(result){
		var i=0;
		var names=["",""];
		$(result).each(function(){
			names[i]=this.name;
			i++;
		});
		var names = $.map(names,function(value,i) {
			return {'id':i,'name':value,'email':value+"@email.com"};
		});
		$('textarea').atwho('@', {
			data: names,
			tpl: "<li data-value='${name}'>${name} <small>${email}</small></li>"
		}).atwho(':', {
			data: emojis,
			tpl:"<li data-value='${key}'>${name} </li>"
		});
		var emojis = $.map(emojis, function(value, i){return {key: value + ':', name:value};});
		
		
	});







	
